<?php
namespace BP\Sys;

use BP\En\EntityMyPK;

require_once("BP/En/Map.php");
class FrmImgAthDB extends EntityMyPK {
	public function getSort () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$Sort);
	}
	public function setSort ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$Sort, $value);
	}
	public function getRDT () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$RDT);
	}
	public function setRDT ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$RDT, $value);
	}
	public function getFileFullName () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$FileFullName);
	}
	public function setFileFullName ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FileFullName, $value);
	}
	public function getFilePathName () 
	{
		return $this->getFileFullName()->substring(($this->getFileFullName()->lastIndexOf('\\') + 1));
	}
	public function getFileName () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$FileName);
	}
	public function setFileName ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FileName, $value);
	}
	public function getFileExts () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$FileExts);
	}
	public function setFileExts ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FileExts, $value->replace(".", ""));
	}
	public function getFK_FrmImgAth () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$FK_FrmImgAth);
	}
	public function setFK_FrmImgAth ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FK_FrmImgAth, $value);
	}
	public function getRefPKVal () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$RefPKVal);
	}
	public function setRefPKVal ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$RefPKVal, $value);
	}
	public function getMyNote () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$MyNote);
	}
	public function setMyNote ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$MyNote, $value);
	}
	public function getRec () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$Rec);
	}
	public function setRec ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$Rec, $value);
	}
	public function getRecName () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$RecName);
	}
	public function setRecName ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$RecName, $value);
	}
	public function getFK_MapData () 
	{
		return $this->GetValStringByKey(FrmImgAthDBAttr::$FK_MapData);
	}
	public function setFK_MapData ($value) // [String value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FK_MapData, $value);
	}
	public function getFileSize () 
	{
		return $this->GetValFloatByKey(FrmImgAthDBAttr::$FileSize);
	}
	public function setFileSize ($value) // [float value]
	{
		$this->SetValByKey(FrmImgAthDBAttr::$FileSize, ($value / 1024));
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($mypk) // [String mypk]
	{
		$me = new self();
		$me->setMyPK($mypk);
		$me->Retrieve();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FrmImgAthDB", "剪切图片附件数据存储");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->setEnDesc("剪切图片附件数据存储");
		$map->Java_SetEnType($EnType->Sys);
		$map->IndexField = FrmImgAthDBAttr::$RefPKVal;
		$map->AddMyPK();
		$map->AddTBString(FrmImgAthDBAttr::$FK_MapData, NULL, "表单ID",  TRUE ,  FALSE , 1, 100, 20);
		$map->AddTBString(FrmImgAthDBAttr::$FK_FrmImgAth, NULL, "图片附件编号",  TRUE ,  FALSE , 1, 50, 20);
		$map->AddTBString(FrmImgAthDBAttr::$RefPKVal, NULL, "实体主键",  TRUE ,  FALSE , 1, 50, 20);
		$map->AddTBString(FrmImgAthDBAttr::$FileFullName, NULL, "文件全路�?",  TRUE ,  FALSE , 0, 700, 20);
		$map->AddTBString(FrmImgAthDBAttr::$FileName, NULL, "名称",  TRUE ,  FALSE , 0, 500, 20);
		$map->AddTBString(FrmImgAthDBAttr::$FileExts, NULL, "扩展�?",  TRUE ,  FALSE , 0, 50, 20);
		$map->AddTBFloat(FrmImgAthDBAttr::$FileSize, 0, "文件大小",  TRUE ,  FALSE );
		$map->AddTBDateTime(FrmImgAthDBAttr::$RDT, NULL, "记录日期",  TRUE ,  FALSE );
		$map->AddTBString(FrmImgAthDBAttr::$Rec, NULL, "记录�?",  TRUE ,  FALSE , 0, 50, 20);
		$map->AddTBString(FrmImgAthDBAttr::$RecName, NULL, "记录人名�?",  TRUE ,  FALSE , 0, 50, 20);
		$map->AddTBStringDoc(FrmImgAthDBAttr::$MyNote, NULL, "备注",  TRUE ,  FALSE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function beforeInsert () 
	{
		$this->setMyPK((($this->getFK_FrmImgAth() . "_") . $this->getRefPKVal()));
		return parent->beforeInsert();
	}
	protected function beforeUpdate () 
	{
		$this->setMyPK((($this->getFK_FrmImgAth() . "_") . $this->getRefPKVal()));
		return parent->beforeUpdate();
	}
}
?>
